home *** CD-ROM | disk | FTP | other *** search
- 1 rem (c)1987 uptime magazine
- 2 rem (c)1987 softdisk publishing, inc.
- 3 :
- 4 rem authors: john bayes
- 5 rem dave hammond
- 6 :
- 9 uptime=(8*4096)+4
- 10 dim mnth$(12),maxday(12),days(31)
- 15 for a=1to12: read mnth$(a), maxday(a): next: print"[147]"
- 16 :
- 20 gosub 2000: rem *** set up screen ***
- 21 :
- 22 get k$: if (k$<>" ") and (k$<>chr$(140)) then 22
- 23 if k$=chr$(140) then poke 186,8: sys uptime
- 24 :
- 25 mn=0: mnth$="": gosub 2200: rem *** prompt #1 ***
- 26 :
- 30 get k$: if (k$<>"1") and (k$<>"2") then 30
- 35 on val(k$) gosub 2300, 2500: rem *** 1=month, 2=year ***
- 36 :
- 40 date$=mnth$+", "+t$
- 42 if mn=0 then date$="[212]he year "+t$
- 46 gosub 1800: rem *** pad the date ***
- 48 :
- 50 gosub 2600: rem *** prompt #2 ***
- 60 get k$: if (k$<"1") or (k$>"3") then 60
- 70 on val(k$) goto 100, 400, 700: rem *** 1-screen, 2-printer, 3-restart ***
- 95 :
- 96 rem ******************
- 97 rem output to screen
- 98 rem ******************
- 99 :
- 100 year$=right$(str$(yr),4): py=yr
- 108 bm=1: lm=12: if mn<>0 then bm=mn: lm=mn
- 109 :
- 110 for y=bmtolm
- 115 mn=y: yr=py
- 120 gosub 1700: rem *** display calendar template ***
- 130 gosub 6000: rem *** calc the calendar ***
- 140 gosub 1600: rem *** display days of month ***
- 145 :
- 150 print"";
- 165 p$="[195]alendar for "+mnth$(y)+", "+year$
- 170 z=int((40-len(p$))/2)
- 175 printspc(z)"[146][159]"p$
- 195 printspc(6)"[146][159][208]ress [211]pace [194]ar[159] to continue"
- 200 get k$: if k$<>" " then 200
- 210 gosub 1940: next
- 230 goto 20: rem *** restart ***
- 395 :
- 396 rem *******************
- 397 rem output to printer
- 398 rem *******************
- 399 :
- 400 gosub 2700: rem *** prompt for lptr ***
- 405 :
- 410 get k$: if (k$<>"1") and (k$<>"2") then 410
- 420 if k$="2" then goto 50
- 430 close 4: open4,4,7: if (st and 128) then close4: gosub 2800: goto 400
- 435 :
- 440 gosub 1400: rem *** def lptr strings ***
- 445 :
- 450 year$=right$(str$(yr),4): py=yr
- 460 bm=1: lm=12: if mn<>0 then bm=mn: lm=mn
- 465 :
- 466 rem ************
- 467 rem print loop
- 468 rem ************
- 469 :
- 470 mn=bm: yr=py
- 475 :
- 480 gosub 1700: rem *** display calendar template ***
- 490 gosub 6000: rem *** calc the calendar ***
- 500 gosub 1600: rem *** screen output ***
- 501 :
- 502 print"";
- 504 p$="[195]alendar for "+mnth$(bm)+", "+year$
- 506 z=int((40-len(p$))/2)
- 508 printspc(z)"[146][159]"p$
- 509 :
- 510 gosub 2900: rem *** lptr output ***
- 515 :
- 560 printspc(6)"[146][159][208]ress [211]pace [194]ar[159] to continue"
- 570 get k$: if k$<>" " then 570
- 580 gosub 1940: bm=bm+1: if bm<=lm then 470: rem *** continue
- 590 print#4: close4: goto 20: rem *** restart ***
- 695 :
- 696 rem *****************
- 697 rem incorrect entry
- 698 rem *****************
- 699 :
- 700 gosub 1900
- 710 print"";
- 720 gosub 2120
- 730 goto 22
- 995 :
- 996 rem ***************
- 997 rem calendar data
- 998 rem ***************
- 999 :
- 1000 data "[202]anuary",31,"[198]ebruary",29,"[205]arch",31
- 1010 data "[193]pril",30,"[205]ay",31,"[202]une",30,"[202]uly",31
- 1020 data "[193]ugust",31,"[211]eptember",30,"[207]ctober",31
- 1030 data "[206]ovember",30,"[196]ecember",31
- 1395 :
- 1396 rem ************************
- 1397 rem define printer strings
- 1398 rem ************************
- 1399 :
- 1400 p1$="[176][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178]"
- 1402 p2$="[192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][178][192][192][192][192][192][192][192][192][192][174]"
- 1404 p3$="[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219]"
- 1406 p4$="[192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179]"
- 1408 p5$="[173][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177]"
- 1410 p6$="[192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][177][192][192][192][192][192][192][192][192][192][189]"
- 1412 p7$="[221] [221] [221] [221]"
- 1414 p8$=" [221] [221] [221] [221]"
- 1420 p3$="[171][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219]"
- 1430 p4$="[192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][219][192][192][192][192][192][192][192][192][192][179]"
- 1440 return
- 1595 :
- 1596 rem **********************
- 1597 rem print days to screen
- 1598 rem **********************
- 1599 :
- 1600 f=0: print"";
- 1605 for x=1toeom
- 1610 if (day(1)=0) then goto 1650
- 1611 :
- 1615 if f=1 then 1650
- 1620 f=1: b=day(1)
- 1630 for x1=1tob: print" ";
- 1640 next
- 1645 :
- 1650 x$=str$(x): if len(x$)>2 then x$=right$(x$,2)
- 1660 print"";x$;"";
- 1670 if peek(211)=38 then print:print"";
- 1675 if peek(214)=18 then print"[145][145]";
- 1680 next
- 1690 return
- 1695 :
- 1696 rem ******************
- 1697 rem display calendar
- 1698 rem ******************
- 1699 :
- 1700 print"";tl$
- 1710 print" [221][211]un.[221][205]on.[221][212]ue.[221][215]ed.[221][212]hr.[221][198]ri.[221][211]at.[221]"
- 1720 print" ";m2$
- 1730 for x=1to14
- 1740 p$=m1$: if (x/3)=int(x/3) then p$=m2$
- 1750 print" ";p$
- 1760 next
- 1770 print" "bl$
- 1780 return
- 1795 :
- 1796 rem **************
- 1797 rem pad the date
- 1798 rem **************
- 1799 :
- 1800 pad=int((18-len(date$))/2)
- 1810 for x=1topad
- 1820 date$=" "+date$
- 1830 next
- 1840 date$=left$(date$+" ",18)
- 1850 return
- 1895 :
- 1896 rem *****************
- 1897 rem clear text area
- 1898 rem *****************
- 1899 :
- 1900 print"";
- 1910 printspc(11)"[158] "
- 1920 print"";
- 1930 for x=1to4: printspc(11)"[158] ": next
- 1940 print"";
- 1950 for x=1to6: print" ";
- 1953 if x<6 then print
- 1955 next
- 1960 print"";
- 1970 return
- 1995 :
- 1996 rem ***************
- 1997 rem set up screen
- 1998 rem ***************
- 1999 :
- 2000 poke 53280,0: poke 53281,0
- 2010 printchr$(8)chr$(14)
- 2020 tl$="[176][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][178][192][192][192][192][174]"
- 2030 bl$="[173][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][177][192][192][192][192][189]"
- 2040 m1$="[221] [221] [221] [221] [221] [221] [221] [221]"
- 2050 m2$="[171][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][219][192][192][192][192][179]"
- 2060 gosub 1700: rem *** display calendar ***
- 2120 printspc(4)"[159][208]ress the [211]pace [194]ar[159] to continue"
- 2125 printspc(7)"[159][208]ress [198]8[159] to exit to [213]p[212]ime"
- 2130 printspc(3)"[158](c)1987 [211]oftdisk [208]ublishing, [201]nc."
- 2140 printspc(9)"[151] "
- 2142 printspc(9)"[151] [158][176][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][174]"
- 2144 printspc(9)"[151] [158][221] [195]alendar [195]reator [221]"
- 2146 printspc(9)"[151] [158][171][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][179]"
- 2148 printspc(9)"[151] [158][221] by [221]"
- 2150 printspc(9)"[151] [158][221] [202]ohn [194]ayes [221]"
- 2152 printspc(9)"[151] [158][221] and [221]"
- 2154 printspc(9)"[151] [158][221] [196]ave [200]ammond [221]"
- 2156 printspc(10)"[158][173][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][192][189]"
- 2190 return
- 2195 :
- 2196 rem ***********
- 2197 rem prompt #1
- 2198 rem ***********
- 2199 :
- 2200 gosub 1900: rem *** clear text area ***
- 2205 :
- 2210 printspc(11)"[158] [212]ype of [195]alendar"
- 2220 printspc(11)"[158] 1[158]- [205]onth"
- 2230 printspc(11)"[158] 2[158]- [217]ear
- 2240 [153]""
- 2250 [153][166]7)"open(NULL)elect by (NULL)ressing 1open or 2open"
- 2260 [142]
- 2295 :
- 2296 [143] **************
- 2297 [143] month select
- 2298 [143] **************
- 2299 :
- 2300 [141] 1900: [143] *** clear text area ***
- 2305 :
- 2310 [153][166]11)"sys (NULL)onth lenalendar"
- 2320 [153][166]11)" (NULL)elect a month"
- 2325 [153][166]11)" by number"
- 2330 [153][166]11)" from this list"
- 2335 [153][166]11)" and press <len(NULL)>"
- 2340 [153]"";
- 2350 [129] x[178]1[164]4
- 2360 [153]" "x"cmdopen. ";
- 2365 pt$[178][200](mnth$(x)[170]" ",8)
- 2370 [153]pt$;
- 2375 [153]" "x[170]4"cmdopen. ";
- 2380 pt$[178][200](mnth$(x[170]4)[170]" ",7)
- 2385 [153]pt$;
- 2387 [153]"";: [139] x[170]8[178]9 [167] [153]" ";
- 2390 [153]x[170]8"cmdopen. ";
- 2395 pt$[178]mnth$(x[170]8)
- 2400 [153]pt$
- 2410 [130]
- 2411 :
- 2415 [153][166]16)"sys-> waitsys <-cmdcmdcmdcmdcmdcmd";
- 2420 ml[178]2: [141] 5000: [143] *** get kbd input ***
- 2421 :
- 2425 [139] ([197](t$)[177]12) [176] ([197](t$)[179]1) [167] [153]"cmdcmd cmdcmd";: [137] 2420
- 2430 mn[178][197](t$): mnth$[178]mnth$(mn)
- 2495 :
- 2496 [143] ***************
- 2497 [143] year calendar
- 2498 [143] ***************
- 2499 :
- 2500 [141] 1900: [143] *** clear text area ***
- 2505 :
- 2510 [139] mnth$[178]"" [167] mnth$[178]"(NULL)ear lenalendar"
- 2515 date$[178]mnth$
- 2520 [141] 1800: [143] *** pad the date ***
- 2525 :
- 2560 [153][166]11)"sys"date$
- 2570 [153][166]11)" (NULL)elect a year"
- 2572 [153][166]11)"chr$reater than 1752"
- 2574 [153][166]14)"sys-> waitsys <-cmdcmdcmdcmdcmdcmdcmdcmd";
- 2580 ml[178]4: [141] 5000: [143] *** kbd input ***
- 2582 yr[178][197](t$)
- 2584 [139] yr[179]1752 [167] [129] x[178]1[164][195](t$): [153]"cmd cmd";: [130]: [137] 2580
- 2590 [142]
- 2595 :
- 2596 [143] ***********
- 2597 [143] prompt #2
- 2598 [143] ***********
- 2600 [141] 1900: [143] *** clear text area ***
- 2605 :
- 2610 [153][166]11)"sys"date$
- 2620 [153][166]11)" (NULL)elect one:"
- 2630 [153][166]11)" 1sys- (NULL)creen"
- 2640 [153][166]11)" 2sys- (NULL)rinter"
- 2650 [153][166]11)" 3sys- right$ncorrect"
- 2660 [142]
- 2695 :
- 2696 [143] *****************
- 2697 [143] prompt for lptr
- 2698 [143] *****************
- 2699 :
- 2700 [141] 1900: [143] *** clear text area ***
- 2705 :
- 2710 [153][166]11)"sys (NULL)rinter (NULL)utput"
- 2720 [153][166]11)"sys 1sys- (NULL)rinter ready"
- 2730 [153][166]11)"sys 2sys- (NULL)ot ready"
- 2740 [142]
- 2795 :
- 2796 [143] ****************
- 2797 [143] lptr not ready
- 2798 [143] ****************
- 2799 :
- 2800 [141] 1900: [143] *** clear text area ***
- 2805 :
- 2810 [153][166]11)"sys (NULL)(NULL)(NULL)(NULL) not ready"
- 2820 [153][166]11)" lenheck the"
- 2830 [153][166]11)" printer's (NULL)(NULL)/(NULL)ascasc"
- 2840 [153][166]11)" switch and paper"
- 2850 [153][166]11)" supply."
- 2855 :
- 2860 [129] c[178]1[164]2000: [130]
- 2870 [142]
- 2895 :
- 2896 [143] **********************
- 2897 [143] dump days to printer
- 2898 [143] **********************
- 2899 :
- 2900 [152]4,[199](10)[199](10)
- 2905 d$[178]mnth$(bm)[170]", "[170]year$
- 2910 z[178][181]((40[171][195](d$))[173]2)
- 2920 [152]4,[199](14);"";[166]z);d$;[199](15);[199](10): [143] *** page title ***
- 2930 [152]4,""[166]5)p1$p2$
- 2935 [152]4,""[166]5)"(NULL) (NULL)unday (NULL) (NULL)onday (NULL) (NULL)uesday (NULL)";
- 2940 [152]4,"(NULL)ednesday(NULL) (NULL)hursday(NULL) ascriday (NULL) (NULL)aturday(NULL)"
- 2950 [152]4,""[166]5)p3$p4$
- 2955 :
- 2960 [139] day(1)[178]0 [167] [152]4,""[166]5);: [137] 2990
- 2965 :
- 2970 b[178]day(1): [152]4,""[166]5);
- 2975 [129] x[178]1[164]b
- 2980 [152]4,"(NULL) ";
- 2985 [130]
- 2990 d[178]1
- 3000 d$[178][196](d): [139] [195](d$)[177]2 [167] d$[178][201](d$,2)
- 3005 [152]4,"(NULL) ";[199](14);d$;[199](15);" ";
- 3010 d[178]d[170]1
- 3020 [139] d[177]eom [167] 3050
- 3030 b[178]day(d): [139] b[178]0 [167] [152]4,"(NULL)": [141] 3100
- 3040 [137] 3000
- 3045 :
- 3050 [139] b[179][177]6 [167] [141] 3160: [143] *** finish row ***
- 3052 [152]4,"(NULL)"
- 3055 [129] x[178]1[164]5
- 3060 [152]4,""[166]5)p7$p8$
- 3070 [130]
- 3080 [152]4,""[166]5)p5$p6$
- 3090 [152]4,[199](12): [142]
- 3095 :
- 3096 [143] **********************
- 3097 [143] finish line of boxes
- 3098 [143] **********************
- 3099 :
- 3100 [129] x[178]1[164]4
- 3110 [152]4,""[166]5)p7$p8$
- 3120 [130]
- 3130 [152]4,""[166]5)p7$p8$
- 3135 [152]4,""[166]5)p3$p4$
- 3140 [152]4,""[166]5);
- 3150 [142]
- 3155 :
- 3156 [143] *********************
- 3157 [143] finish row of boxes
- 3158 [143] *********************
- 3159 :
- 3160 [129] x[178]b[164]5
- 3165 [152]4,"(NULL) ";
- 3170 [130]
- 3190 [142]
- 4095 :
- 4995 :
- 4996 [143] ***********
- 4997 [143] kbd input
- 4998 [143] ***********
- 4999 :
- 5000 ct[178]0: t$[178]""
- 5010 [161] k$: [139] k$[178]"" [167] 5010
- 5020 [139] k$[178][199](13) [167] 5090
- 5030 [139] k$[179][177][199](20) [167] 5060
- 5040 [139] ct[178]0 [167] 5010
- 5050 ct[178]ct[171]1: t$[178][200](t$,ct): [153]"cmd cmd";: [137] 5010
- 5060 [139] ct[178]ml [167] 5010
- 5070 [139] (k$[179]"0") [176] (k$[177]"9") [167] 5010
- 5080 ct[178]ct[170]1: t$[178]t$[170]k$: [153]k$;: [137] 5010
- 5090 [139] ct[178]0 [167] 5010
- 5100 [142]
- 5995 :
- 5996 [143] ********************
- 5997 [143] calendar algorithm
- 5998 [143] ********************
- 5999 :
- 6000 eom[178]maxday(mn)
- 6010 [139] mn [179][177] 2 [167] 6040
- 6020 day[178]29: mn[178]12: yr[178]yr[171]1: [141] 6080
- 6025 t0[178]t: day[178]1: mn[178]1: yr[178]yr[170]1: [141] 6080: mn[178]2
- 6030 [139] t [178] t0 [167] eom [178] 28: [143] *** no leap year ***
- 6040 mn[178]mn[171]2: [139] (mn[179]1) [176] (mn[177]10) [167] mn[178]mn[170]12: yr[178]yr[171]1
- 6050 cent[178][181](yr[173]100)
- 6060 yr[178]yr[171](cent[172]100)
- 6070 [129] day[178]1[164] eom: [141] 6080: days(day)[178]t
- 6075 [130]: [142]
- 6080 ly[178][181](yr[173]4): lc[178][181](cent[173]4)
- 6090 t[178](2.6[172]mn[171].2)[170]day[170]yr[170]ly[170]lc[171]cent[171]cent
- 6100 t[178][181](t)[171]([181](t[173]7)[172]7):[142]
-